package src.week7.SHIYAN4.Cryptography.DES;

/**
 * @Author： 20192315裴湘瑞
 * @Date: 2020/10/28 20:44
 * @Version: 1.0
 * @Target：
 * @Requirement：
 */
import java.io.*;
import javax.crypto.*;
public class Skey_DES{
    public static void main(String args[])
            throws Exception{
        KeyGenerator kg=KeyGenerator.getInstance("DESede");
        kg.init(168);
        SecretKey k=kg.generateKey( );
        FileOutputStream  f=new FileOutputStream("key1.dat");
        ObjectOutputStream b=new  ObjectOutputStream(f);
        b.writeObject(k);
    }
}